package com.fanbuchi.fukua.utils;

import android.util.Base64;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * Created by Administrator on 2015/10/22.
 */
public class PassUtils {
    public static String encode(String pass,String key){
        MessageDigest mdInst = null;
        try {
            mdInst = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        mdInst.update(pass.getBytes());
        mdInst.update(key.getBytes());

        byte[] md = mdInst.digest();
        pass=Base64.encodeToString(md,Base64.NO_WRAP);
        return pass;
    }
}
